import 'package:json_annotation/json_annotation.dart';

import '../item_style.dart';
import '../line_style.dart';

part 'series.g.dart';

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class Series {

  Series();

  factory Series.fromJson(Map<String, dynamic> json) =>
      _$SeriesFromJson(json);

  Map<String, dynamic> toJson() => _$SeriesToJson(this);
}

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class SeriesLabel {
  var show;
  var position;
  var distance;
  var rotate;
  var offset;
  var formatter;

  //sunburst
  var minAngle;

  var color;
  var fontStyle;
  var fontWeight;
  var fontFamily;
  var fontSize;
  var align;
  var lineHeight;
  var verticalAlign;
  var backgroundColor;
  var borderColor;
  var borderWidth;
  var borderType;
  var borderDashOffset;
  var borderRadius;
  var padding;

  var shadowColor;
  var shadowBlur;
  var shadowOffsetX;
  var shadowOffsetY;

  var width;
  var height;

  var textBorderColor;
  var textBorderWidth;
  var textBorderType;
  var textBorderDashOffset;
  var textShadowColor;
  var textShadowBlur;
  var textShadowOffsetX;
  var textShadowOffsetY;
  var overFlow;
  var ellipsis;
  var lineOverflow;

  var rich;

  SeriesLabel(
      {this.show,
      this.position,
      this.distance,
      this.rotate,
      this.offset,
      this.formatter,
      this.color,
      this.fontStyle,
      this.fontWeight,
      this.fontFamily,
      this.fontSize,
      this.align,
      this.lineHeight,
      this.verticalAlign,
      this.backgroundColor,
      this.borderColor,
      this.borderWidth,
      this.borderType,
      this.borderDashOffset,
      this.borderRadius,
      this.padding,
      this.shadowColor,
      this.shadowBlur,
      this.shadowOffsetX,
      this.shadowOffsetY,
      this.width,
      this.height,
      this.textBorderColor,
      this.textBorderWidth,
      this.textBorderType,
      this.textBorderDashOffset,
      this.textShadowColor,
      this.textShadowBlur,
      this.textShadowOffsetX,
      this.textShadowOffsetY,
      this.overFlow,
      this.ellipsis,
      this.lineOverflow,
      this.rich});

  factory SeriesLabel.fromJson(Map<String, dynamic> json) =>
      _$SeriesLabelFromJson(json);

  Map<String, dynamic> toJson() => _$SeriesLabelToJson(this);
}

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class LabelLine {
  var show;
  var showAbove;
  var length2;
  var smooth;
  var minTurnAngle;
  LineStyle? lineStyle;

  LabelLine(
      {this.show,
      this.showAbove,
      this.length2,
      this.smooth,
      this.minTurnAngle,
      this.lineStyle});
  factory LabelLine.fromJson(Map<String, dynamic> json) =>
      _$LabelLineFromJson(json);

  Map<String, dynamic> toJson() => _$LabelLineToJson(this);
}

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class LabelLayout {
  var hideOverlap;
  var moveOverlap;
  var x;
  var y;
  var dx;
  var dy;
  var rotate;
  var width;
  var height;
  var align;
  var verticalAlign;
  var fontSize;
  var draggable;
  var abelLinePoints;

  LabelLayout(
      {this.hideOverlap,
      this.moveOverlap,
      this.x,
      this.y,
      this.dx,
      this.dy,
      this.rotate,
      this.width,
      this.height,
      this.align,
      this.verticalAlign,
      this.fontSize,
      this.draggable,
      this.abelLinePoints});
  factory LabelLayout.fromJson(Map<String, dynamic> json) =>
      _$LabelLayoutFromJson(json);

  Map<String, dynamic> toJson() => _$LabelLayoutToJson(this);
}

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class SeriesDecal {
  var symbol;
  var symbolSize;
  var symbolKeepAspect;
  var color;
  var backgroundColor;
  var dashArrayX;
  var ashArrayY;
  var rotation;
  var maxTileWidth;
  var maxTileHeight;

  SeriesDecal(
      {this.symbol,
      this.symbolSize,
      this.symbolKeepAspect,
      this.color,
      this.backgroundColor,
      this.dashArrayX,
      this.ashArrayY,
      this.rotation,
      this.maxTileWidth,
      this.maxTileHeight});
  factory SeriesDecal.fromJson(Map<String, dynamic> json) =>
      _$SeriesDecalFromJson(json);

  Map<String, dynamic> toJson() => _$SeriesDecalToJson(this);

}

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class SeriesItemStyle {
  var color;
  var borderColor;
  var borderWidth;
  var borderType;
  var borderDashOffset;
  var borderCap;
  var borderJoin;
  var borderMiterLimit;
  var shadowBlur;
  var shadowColor;
  var shadowOffsetX;
  var shadowOffsetY;
  var opacity;
  SeriesDecal? decal;
  var borderRadius;

  SeriesItemStyle(
      {this.color,
      this.borderColor,
      this.borderWidth,
      this.borderType,
      this.borderDashOffset,
      this.borderCap,
      this.borderJoin,
      this.borderMiterLimit,
      this.shadowBlur,
      this.shadowColor,
      this.shadowOffsetX,
      this.shadowOffsetY,
      this.opacity,
      this.decal,
      this.borderRadius});
  factory SeriesItemStyle.fromJson(Map<String, dynamic> json) =>
      _$SeriesItemStyleFromJson(json);

  Map<String, dynamic> toJson() => _$SeriesItemStyleToJson(this);
}

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class SeriesAreaStyle {
  var color;
  var origin;
  var shadowBlur;
  var shadowColor;
  var shadowOffsetX;
  var shadowOffsetY;
  var opacity;

  SeriesAreaStyle(
      {this.color,
      this.origin,
      this.shadowBlur,
      this.shadowColor,
      this.shadowOffsetX,
      this.shadowOffsetY,
      this.opacity});
  factory SeriesAreaStyle.fromJson(Map<String, dynamic> json) =>
      _$SeriesAreaStyleFromJson(json);

  Map<String, dynamic> toJson() => _$SeriesAreaStyleToJson(this);
}

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class MarkBlurSelectEmphasis {
  SeriesLabel? label;
  ItemStyle? itemStyle;

  MarkBlurSelectEmphasis({this.label, this.itemStyle});
  factory MarkBlurSelectEmphasis.fromJson(Map<String, dynamic> json) =>
      _$MarkBlurSelectEmphasisFromJson(json);

  Map<String, dynamic> toJson() => _$MarkBlurSelectEmphasisToJson(this);
}

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class MarkPointData {
  var name;
  var type;
  var valueIndex;
  var valueDim;
  var coord;
  var x;
  var y;
  var value;
  var symbol;
  var symbolSize;
  var symbolRotate;
  var symbolKeepAspect;
  var symbolOffset;
  ItemStyle? itemStyle;
  SeriesLabel? label;
  MarkBlurSelectEmphasis? emphasis;
  var animation;
  var animationThreshold;
  var animationDuration;
  var animationEasing;
  var animationDelay;
  var animationDurationUpdate;
  var animationEasingUpdate;
  var animationDelayUpdate;

  MarkPointData(
      {this.name,
      this.type,
      this.valueIndex,
      this.valueDim,
      this.coord,
      this.x,
      this.y,
      this.value,
      this.symbol,
      this.symbolSize,
      this.symbolRotate,
      this.symbolKeepAspect,
      this.symbolOffset,
      this.itemStyle,
      this.label,
      this.emphasis,
      this.animation,
      this.animationThreshold,
      this.animationDuration,
      this.animationEasing,
      this.animationDelay,
      this.animationDurationUpdate,
      this.animationEasingUpdate,
      this.animationDelayUpdate});

  factory MarkPointData.fromJson(Map<String, dynamic> json) =>
      _$MarkPointDataFromJson(json);

  Map<String, dynamic> toJson() => _$MarkPointDataToJson(this);
}

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class MarkPoint {
  var symbol;
  var symbolSize;
  var symbolRotate;
  var symbolKeepAspect;
  var symbolOffset;
  var silent;

  SeriesLabel? label;
  ItemStyle? itemStyle;
  MarkBlurSelectEmphasis? emphasis;
  MarkBlurSelectEmphasis? blur;
  List<MarkPointData>? data;

  var animation;
  var animationThreshold;
  var animationDuration;
  var animationEasing;
  var animationDelay;
  var animationDurationUpdate;
  var animationEasingUpdate;
  var animationDelayUpdate;

  MarkPoint(
      {this.symbol,
      this.symbolSize,
      this.symbolRotate,
      this.symbolKeepAspect,
      this.symbolOffset,
      this.silent,
      this.label,
      this.itemStyle,
      this.emphasis,
      this.blur,
      this.data,
      this.animation,
      this.animationThreshold,
      this.animationDuration,
      this.animationEasing,
      this.animationDelay,
      this.animationDurationUpdate,
      this.animationEasingUpdate,
      this.animationDelayUpdate});

  factory MarkPoint.fromJson(Map<String, dynamic> json) =>
      _$MarkPointFromJson(json);

  Map<String, dynamic> toJson() => _$MarkPointToJson(this);
}

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class MarkLineDataBlurEmphasis {
  SeriesLabel? label;
  LineStyle? lineStyle;

  MarkLineDataBlurEmphasis({this.label, this.lineStyle});
  factory MarkLineDataBlurEmphasis.fromJson(Map<String, dynamic> json) =>
      _$MarkLineDataBlurEmphasisFromJson(json);

  Map<String, dynamic> toJson() => _$MarkLineDataBlurEmphasisToJson(this);
}

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class MarkLineData {
  var type;
  var valueIndex;
  var valueDim;
  var coord;
  var name;
  var x;
  var y;
  var xAxis;
  var yAxis;
  var value;
  var symbol;
  var symbolSize;
  var symbolRotate;
  var symbolKeepAspect;

  var symbolOffset;
  LineStyle? lineStyle;
  SeriesLabel? label;
  MarkLineDataBlurEmphasis? emphasis;
  MarkLineDataBlurEmphasis? blur;

  MarkLineData(
      {this.type,
      this.valueIndex,
      this.valueDim,
      this.coord,
      this.name,
      this.x,
      this.y,
      this.xAxis,
      this.yAxis,
      this.value,
      this.symbol,
      this.symbolSize,
      this.symbolRotate,
      this.symbolKeepAspect,
      this.symbolOffset,
      this.lineStyle,
      this.label,
      this.emphasis,
      this.blur});
  factory MarkLineData.fromJson(Map<String, dynamic> json) =>
      _$MarkLineDataFromJson(json);

  Map<String, dynamic> toJson() => _$MarkLineDataToJson(this);
}

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class MarkLine {
  var silent;
  var symbol;
  var symbolSize;
  var precision;
  SeriesLabel? label;
  LineStyle? lineStyle;
  MarkLineDataBlurEmphasis? emphasis;
  MarkLineDataBlurEmphasis? blur;
  Map<int, MarkLineData>? data;

  var animation;
  var animationThreshold;
  var animationDuration;
  var animationEasing;
  var animationDelay;
  var animationDurationUpdate;
  var animationEasingUpdate;
  var animationDelayUpdate;

  MarkLine(
      {this.silent,
      this.symbol,
      this.symbolSize,
      this.precision,
      this.label,
      this.lineStyle,
      this.emphasis,
      this.blur,
      this.data,
      this.animation,
      this.animationThreshold,
      this.animationDuration,
      this.animationEasing,
      this.animationDelay,
      this.animationDurationUpdate,
      this.animationEasingUpdate,
      this.animationDelayUpdate});

  factory MarkLine.fromJson(Map<String, dynamic> json) =>
      _$MarkLineFromJson(json);

  Map<String, dynamic> toJson() => _$MarkLineToJson(this);
}

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class MarkAreaData {
  var type;
  var valueIndex;
  var valueDim;
  var coord;
  var name;
  var x;
  var y;
  var xAxis;
  var yAxis;
  var value;
  var symbol;
  var symbolSize;
  var symbolRotate;
  var symbolKeepAspect;

  var symbolOffset;
  ItemStyle? itemStyle;
  SeriesLabel? label;
  MarkPoint? emphasis;
  MarkPoint? blur;

  MarkAreaData(
      {this.type,
      this.valueIndex,
      this.valueDim,
      this.coord,
      this.name,
      this.x,
      this.y,
      this.xAxis,
      this.yAxis,
      this.value,
      this.symbol,
      this.symbolSize,
      this.symbolRotate,
      this.symbolKeepAspect,
      this.symbolOffset,
      this.itemStyle,
      this.label,
      this.emphasis,
      this.blur});

  factory MarkAreaData.fromJson(Map<String, dynamic> json) =>
      _$MarkAreaDataFromJson(json);

  Map<String, dynamic> toJson() => _$MarkAreaDataToJson(this);
}

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class MarkArea {
  var silent;
  SeriesLabel? label;
  ItemStyle? itemStyle;
  MarkBlurSelectEmphasis? emphasis;
  MarkBlurSelectEmphasis? blur;
  Map<int, MarkAreaData>? data;

  var animation;
  var animationThreshold;
  var animationDuration;
  var animationEasing;
  var animationDelay;
  var animationDurationUpdate;
  var animationEasingUpdate;
  var animationDelayUpdate;

  MarkArea(
      {this.silent,
      this.label,
      this.itemStyle,
      this.emphasis,
      this.blur,
      this.data,
      this.animation,
      this.animationThreshold,
      this.animationDuration,
      this.animationEasing,
      this.animationDelay,
      this.animationDurationUpdate,
      this.animationEasingUpdate,
      this.animationDelayUpdate});

  factory MarkArea.fromJson(Map<String, dynamic> json) =>
      _$MarkAreaFromJson(json);

  Map<String, dynamic> toJson() => _$MarkAreaToJson(this);
}
